var arr = [[1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 9, [11, 12, [12, 13, [14]]]], 10];

arr = [...new Set(arr.flat(Infinity))];

console.log(quick(arr, 0, arr.length - 1) );

function quick(array, start, end) {
  if (end - start < 1) return;
  const target = array[start];
  let l = start,
    r = end;
  while (l < r) {
    while (target <= array[r] && l < r) {
      r--;
    }
    array[l] = array[r];
    while (target > array[l] && l < r) {
      l++;
    }
    array[r] = array[l];
    array[l] = target;
  }
  quick(array, l + 1, end);
  quick(array, start, l - 1);
  return array;
}

